<?
if(!defined ('U_MOD'))
{
	echo"<meta http-equiv='refresh' content='0;url=/index.php'>";
	exit;
}

$avialable_langs = explode(",", $option['avialable_langs']);
$avialable_langs_desc = explode(",", $option['avialable_langs_desc']);

if (!isset($lang) || empty($lang) || $lang=='' || is_numeric($lang))
{
	$langSelected=$option['default_lang'];
}else
	$langSelected=$lang;

print '<p><form name="langSelect" method="post" action="'.$portal_url.'/admin.php?amk='.$amk.'">
	<select name="lang" onchange="document.langSelect.submit();">';
		GetLangsList($avialable_langs, $avialable_langs_desc, $langSelected);
	print'</select>';
print'</form></p>';

$queryGetSettings=mysql_query("SELECT * FROM ".$PortalPref.$amk." INNER JOIN ".$PortalPref."langs_".$langSelected." ON ".$PortalPref.$amk.".settings_value=".$PortalPref."langs_".$langSelected.".lang_param");
$queryGetMetatags=mysql_query("SELECT * FROM ".$PortalPref."metatags INNER JOIN ".$PortalPref."langs_".$langSelected." ON ".$PortalPref."metatags.metatags_content=".$PortalPref."langs_".$langSelected.".lang_param");
$queryGetUrl=mysql_query("SELECT * FROM ".$PortalPref.$amk." WHERE settings_parametr='portal_url' OR settings_parametr='portal_timeshift'");

print '<table width="100%" align="center">';

	$dd=1;
	while($resultGetSettings=mysql_fetch_assoc($queryGetSettings))
	{
		$dd++;$iclass = ($dd % 2) ? "even" : "odd";
		$modifyIcon='<a href="'.$portal_url.'/admin.php?amk=languages&apk=manage&act=3&lvid='.$resultGetSettings['settings_value'].'&mod='.$resultGetSettings['lang_module'].'&ref='.$amk.'"><img src="'.$portal_url.'/images/icon/16x16_png/modify.png" id="img-action" title="'._MODIFY_TITLE_.'" ></a>';
		print '<tr id="'.$iclass.'">
			<td>'.pEcho($resultGetSettings['settings_name']).'</td>
			<td>'.pEcho($resultGetSettings['lang_value']).'</td>
			<td>'.$modifyIcon.'</td>
		</tr>';
	}
	while($ResultGetUrl=mysql_fetch_assoc($queryGetUrl))
	{
		if ($ResultGetUrl['settings_parametr']=='portal_timeshift')
		{			$servetTime=_PORTAL_SERVER_TIME_.' '.date('H:i:s')." - ";
		}
		$dd++;$iclass = ($dd % 2) ? "even" : "odd";
		$modifyIcon='<a href="'.$portal_url.'/admin.php?amk='.$amk.'&apk=change&act=3&sid='.$ResultGetUrl['settings_id'].'"><img src="'.$portal_url.'/images/icon/16x16_png/modify.png" id="img-action" title="'._MODIFY_TITLE_.'" ></a>';
		print '<tr id="'.$iclass.'">
			<td>'.pEcho($ResultGetUrl['settings_name']).'</td>
			<td>'.$servetTime.''.$ResultGetUrl['settings_value'].'</td>
			<td>'.$modifyIcon.'</td>
		</tr>';
	}
	while($resultGetMetatag=mysql_fetch_assoc($queryGetMetatags))
	{
		$dd++;$iclass = ($dd % 2) ? "even" : "odd";
		$modifyIcon='<a href="'.$portal_url.'/admin.php?amk=languages&apk=manage&act=3&lvid='.$resultGetMetatag['metatags_content'].'&mod='.$resultGetMetatag['lang_module'].'&ref='.$amk.'"><img src="'.$portal_url.'/images/icon/16x16_png/modify.png" id="img-action" title="'._MODIFY_TITLE_.'" ></a>';
		print '<tr id="'.$iclass.'">
			<td>'.pEcho($resultGetMetatag['metatags_title']).'</td>
			<td>'.pEcho($resultGetMetatag['metatags_content']).'</td>
			<td>'.$modifyIcon.'</td>
		</tr>';
	}
print'</table>';
?>